'''
Clase abstracta -> Subclases: CPUInstruction y IOInstruction
'''

class Instruction:
    def __init__(self, burst = 1, cpu = 1, io = 0):
        self.burst = burst
        self.cpu = cpu
        self.io = io
    
    def execute(self):
        pass

class CpuInstruction(Instruction):
    def __init__(self, resourse, burst = 1):
        self.burst = burst
        self.instruction = resourse
        self.cpu = 1
        self.io = 0
    
    def execute(self, pcb):
        pcb.state = "%cpu%"
        pcb.currentInstruction = pcb.currentInstruction + 1
        #print('[ejecutando instruccion] %s'% self.instruction)
        print('[ejecutando instrucciones]')
        
          
class IoInstruction(Instruction):
    def __init__(self, resourse, burst = 1):
        self.burst = burst
        self.device = resourse
        self.cpu = 0
        self.io = 1
    
    def execute(self, pcb):
        pcb.state = "%io%"
        pcb.currentInstruction = pcb.currentInstruction + 1
   